import java.awt.GridLayout;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class Circulo extends JFrame {
	private Lienzo jp;

	private void inicializar() {
		setTitle("Dibujo");
		int ancho = Toolkit.getDefaultToolkit().getScreenSize().width;
		int alto = Toolkit.getDefaultToolkit().getScreenSize().height;
		int tAncho = 400;
		int tAlto = 400;
		setSize(tAncho, tAlto);
		setLocation((ancho / 2) - (tAncho / 2), (alto / 2) - (tAlto / 2));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setLayout(new GridLayout(1,1));
		setVisible(true);
		this.jp = new Lienzo();
		this.add(jp);
	}

	public Circulo() {
		inicializar();
		avanzar();
	}

	public static void main(String[] args) {
		new Circulo();
	}

	public void avanzar() {
		for (int x = 50; x < 700; x++) {
			jp.setX(x);
			jp.repaint();
			try {
				Thread.sleep(10);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

	}
}